Add privateendport and publicendport parameters to createPortForwardingRule API#113
Closed
sureshanaparti wants to merge 1 commit intomainfrom
Closed
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the createPortForwardingRule API by introducing two new parameters to control end-port ranges for private and public ports.
- Extended
NewCreatePortForwardingRuleParamssignatures in interface, implementation, and mocks to includeprivateendportandpublicendport. - Updated
requiredParamsmap to mark the new parameters as required. - Adjusted existing tests to invoke the method with the new parameters.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/FirewallService_test.go | Updated test invocation to include privateendport and publicendport. |
| generate/requiredParams.go | Added privateendport and publicendport under createPortForwardingRule. |
| cloudstack/FirewallService_mock.go | Expanded mock signatures and call records for the new parameters. |
| cloudstack/FirewallService.go | Extended interface and implementation methods, mapping new params. |
Comments suppressed due to low confidence (3)
test/FirewallService_test.go:96
- Add assertions in the test to verify that "privateendport" and "publicendport" are correctly set in the params map, ideally using distinct non-zero values to ensure they're passed through.
p := client.Firewall.NewCreatePortForwardingRuleParams("ipaddressid", 0, 0, "protocol", 0, 0, "virtualmachineid")
cloudstack/FirewallService.go:1415
- The function comment above this method should be updated to document the new
privateendportandpublicendportparameters for clarity.
func (s *FirewallService) NewCreatePortForwardingRuleParams(ipaddressid string, privateendport int, privateport int, protocol string, publicendport int, publicport int, virtualmachineid string) *CreatePortForwardingRuleParams {
generate/requiredParams.go:73
- [nitpick] Indentation of the new
createPortForwardingRuleentry appears inconsistent with surrounding map entries; aligning tabs/spaces would improve readability.
"createPortForwardingRule": {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds privateendport and publicendport parameters to createPortForwardingRule API.
Fixes #101